Skip to content

Conversation

@djarran
Copy link
Contributor

@djarran djarran commented Jan 28, 2026

Description: Fix codechecker issues:

Before

Run moodle-plugin-ci codechecker --max-warnings=-1
 RUN  Moodle CodeSniffer standard on tool_crawler
............W..............WWW..E 33 / 33 (100%)



FILE: /home/runner/work/moodle-tool_crawler/moodle-tool_crawler/moodle/admin/tool/crawler/classes/robot/crawler.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 694 | WARNING | Function utf8_decode() has been deprecated (moodle.PHP.DeprecatedFunctions.Deprecated)
 694 | WARNING | Function utf8_decode() is deprecated since PHP 8.2; Use mb_convert_encoding(), UConverter::transcode() or iconv
     |         | instead (PHPCompatibility.FunctionUse.RemovedFunctions.utf8_decodeDeprecated)
------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/runner/work/moodle-tool_crawler/moodle-tool_crawler/moodle/admin/tool/crawler/lang/en/tool_crawler.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------------------------------------------------------
 200 | WARNING | Unexpected comment found. Auto-fixing will not work after this comment
     |         | (moodle.Files.LangFilesOrdering.UnexpectedComment)
 201 | WARNING | Unexpected comment found. Auto-fixing will not work after this comment
     |         | (moodle.Files.LangFilesOrdering.UnexpectedComment)
 202 | WARNING | Unexpected comment found. Auto-fixing will not work after this comment
     |         | (moodle.Files.LangFilesOrdering.UnexpectedComment)
 203 | WARNING | The string key "privacy:no_data_reason" is not in the correct order, it should be before "whenqueued"
     |         | (moodle.Files.LangFilesOrdering.IncorrectOrder)
------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/runner/work/moodle-tool_crawler/moodle-tool_crawler/moodle/admin/tool/crawler/tests/phpunit/robot_crawler_test.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 20 WARNINGS AFFECTING 20 LINES
------------------------------------------------------------------------------------------------------------------------------------
  65 | WARNING | Data provider method "absolute_urls_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 123 | WARNING | Test method test_absolute_urls() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 134 | WARNING | Data provider method "should_auth_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 156 | WARNING | Test method test_should_be_authenticated() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 166 | WARNING | Test method test_param_retention_exists() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 174 | WARNING | Test method test_reset_queries() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 223 | WARNING | Test method test_uri_escaping() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 248 | WARNING | Test method test_redirection_uri_escaping() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 295 | WARNING | Test method test_should_be_excluded() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 358 | WARNING | Data provider method "priority_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 373 | WARNING | Test method test_parse_html_priority_inheritance() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 436 | WARNING | Data provider method "should_be_crawled_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 454 | WARNING | Test method test_should_be_crawled() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 475 | WARNING | Test method test_url_creates_hash() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 526 | WARNING | Data provider method "crawler_url_string_matches_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 561 | WARNING | Test method test_crawler_url_string_matches() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 571 | WARNING | Data provider method "url_validity_check_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 589 | WARNING | Test method test_invalid_url() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
 604 | WARNING | Data provider method "page_title_validity_check_provider" will need to be converted to static in future.
     |         | (moodle.PHPUnit.TestCaseProvider.dataProviderNotStatic)
 619 | WARNING | Test method test_check_page_title_validity() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
------------------------------------------------------------------------------------------------------------------------------------


FILE: /home/runner/work/moodle-tool_crawler/moodle-tool_crawler/moodle/admin/tool/crawler/tests/phpunit/robot_cleanup_test.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 143 | WARNING | Test method test_robot_cleanup() is missing any coverage information, own or at class level
     |         | (moodle.PHPUnit.TestCaseCovers.Missing)
------------------------------------------------------------------------------------------------------------------------------------

After

Running CodeSniffer for ltu on plugin admin/tool/crawler with standard moodle
 RUN  Moodle CodeSniffer standard on tool_crawler
.....W........................... 33 / 33 (100%)



FILE: /var/www/site/admin/tool/crawler/classes/robot/crawler.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
 694 | WARNING | Function utf8_decode() has been deprecated (moodle.PHP.DeprecatedFunctions.Deprecated)
 694 | WARNING | Function utf8_decode() is deprecated since PHP 8.2; Use mb_convert_encoding(), UConverter::transcode() or iconv
     |         | instead (PHPCompatibility.FunctionUse.RemovedFunctions.utf8_decodeDeprecated)
------------------------------------------------------------------------------------------------------------------------------------

Time: 1.92 secs; Memory: 28MB

@djarran djarran self-assigned this Jan 28, 2026
@djarran
Copy link
Contributor Author

djarran commented Jan 28, 2026

@brendanheywood: CI is green now

@brendanheywood brendanheywood merged commit 307e016 into MOODLE_310_STABLE Jan 28, 2026
17 of 19 checks passed
@brendanheywood brendanheywood deleted the ci-fixes branch January 28, 2026 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants